Smart stub or enterprise javaTM bean in a distributed processing system

ABSTRACT

A clustered enterprise Java™ distributed processing system is provided. The distributed processing system includes a first and a second computer coupled to a communication medium. The first computer includes a Java™ virtual machine (JVM) and kernel software layer for transferring messages, including a remote Java™ virtual machine (RJVM). The second computer includes a JVM and a kernel software layer having a RJVM. Messages are passed from a RJVM to the JVM in one computer to the JVM and RJVM in the second computer. Messages may be forwarded through an intermediate server or rerouted after a network reconfiguration. Each computer includes a Smart stub having a replica handler, including a load balancing software component and a failover software component. Each computer includes a duplicated service naming tree for storing a pool of Smart stubs at a node. The computers may be programmed in a stateless, stateless factory, or a stateful programming model. The clustered enterprise Java™ distributed processing system allows for enhanced scalability and fault tolerance.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.60/107,167, filed Nov. 5, 1998.

The following copending U.S. patent applications are assigned to theassignee of the present application, and their disclosures areincorporated herein by reference:

(A) Ser. No. 09/405,318 filed Sep. 23, 1999 by Dean B. Jacobs and AnnoR. Langen, and originally entitled, “CLUSTERED ENTERPRISE JAVA™ HAVING AMESSAGE PASSING KERNEL IN A DISTRIBUTED PROCESSING SYSTEM”;

(B) Ser. No. 09/405,508 filed Sep. 23, 1999 by Dean B. Jacobs and EricM. Halpern, and entitled, “A DUPLICATED NAMING SERVICE IN A DISTRIBUTEDPROCESSING SYSTEM”; and

(C) Ser. No. 09/405,500 filed Sep. 23, 1999 by Dean B. Jacobs and AnnoR. Langen, and originally entitled, “CLUSTERED ENTERPRISE JAVA™ IN ASECURE DISTRIBUTED PROCESSING SYSTEM”.

FIELD OF THE INVENTION

The present invention relates to distributed processing systems and, inparticular, computer software in distributed processing systems.

BACKGROUND OF THE INVENTION

There are several types of distributed processing systems. Generally, adistributed processing system includes a plurality of processingdevices, such as two computers coupled to a communication medium.Communication mediums may include wired mediums, wireless mediums, orcombinations thereof, such as an Ethernet local area network or acellular network. In a distributed processing system, at least oneprocessing device may transfer information on the communication mediumto another processing device.

Client/server architecture 110 illustrated in FIG. 1a is one type ofdistributed processing system. Client/server architecture 110 includesat least two processing devices, illustrated as client 105 andapplication server 103. Additional clients may also be coupled tocommunication medium 104, such as client 108.

Typically, server 103 hosts business logic and/or coordinatestransactions in providing a service to another processing device, suchas client 103 and/or client 108. Application server 103 is typicallyprogrammed with software for providing a service. The software may beprogrammed using a variety of programming models, such as EnterpriseJava™ Bean (“EJB”) 100 b as illustrated in FIGS. 1a-b. The service mayinclude, for example, retrieving and transferring data from a database,providing an image and/or calculating an equation. For example, server103 may retrieve data from database 101 a in persistent storage 101 overcommunication medium 102 in response to a request from client 105.Application server 103 then may transfer the requested data overcommunication medium 104 to client 105.

A client is a processing device which utilizes a service from a serverand may request the service. Often a user 106 interacts with client 106and may cause client 105 to request service over a communication medium104 from application server 103. A client often handles directinteractions with end users, such as accepting requests and displayingresults.

A variety of different types of software may be used to programapplication server 103 and/or client 105. One programming language isthe Java™ programming language. Java™ application object code is loadedinto a Java™ virtual machine (“JVM”). A JVM is a program loaded onto aprocessing device which emulates a particular machine or processingdevice. More information on the Java™ programming language may beobtained at http://www.javasoft.com, which is incorporated by referenceherein.

FIG. 1b illustrates several Java™ Enterprise Application ProgrammingInterfaces (“APIs”) 100 that allow Java™ application code to remainindependent from underlying transaction systems, data-bases and networkinfrastructure. Java™ Enterprise APIs 100 include, for example, remotemethod invocation (“RMI”) 100 a, EJBs 100 b, and Java™ Naming andDirectory Interface (JNDI) 100 c.

RMI 100 a is a distributed programming model often used in peer-to-peerarchitecture described below. In particular, a set of classes andinterfaces enables one Java™ object to call the public method of anotherJava™ object running on a different JVM.

An instance of EJB 100 b is typically used in a client/serverarchitecture described above. An instance of EJB 100 b is a softwarecomponent or a reusable pre-built piece of encapsulated application codethat can be combined with other components. Typically, an instance ofEJB 100 b contains business logic. An EJB 100 b instance stored onserver 103 typically manages persistence, transactions, concurrency,threading, and security.

JNDI 100 c provides directory and naming functions to Java™ softwareapplications.

Client/server architecture 110 has many disadvantages. First,architecture 110 does not scale well because server 103 has to handlemany connections. In other words, the number of clients which may beadded to server 103 is limited. In addition, adding twice as manyprocessing devices (clients) does not necessarily provide you with twiceas much performance. Second, it is difficult to maintain applicationcode on clients 105 and 108. Third, architecture 110 is susceptible tosystem failures or a single point of failure. If server 101 fails and abackup is not available, client 105 will not be able to obtain theservice.

FIG. 1c illustrates a multi-tier architecture 160. Clients 151, 152manage direct interactions with end users, accepting requests anddisplay results. Application server 153 hosts the application code,coordinates communications, synchronizations, and transactions. Databaseserver 154 and portable storage device 155 provides durabletransactional management of the data.

Multi-tier architecture 160 has similar client/server architecture 110disadvantages described above.

FIG. 2 illustrates peer-to-peer architecture 214. Processing devices216, 217 and 218 are coupled to communication medium 213. Processingdevices 216, 217, and 218 include network software 210 a, 210 b, and 210c for communicating over medium 213. Typically, each processing devicein a peer-to-peer architecture has similar processing capabilities andapplications. Examples of peer-to-peer program models include CommonObject Request Broker Architecture (“CORBA”) and Distributed ObjectComponent Model (“DCOM”) architecture.

In a platform specific distributed processing system, each processingdevice may run the same operating system. This allows the use ofproprietary hardware, such as shared disks, multi-tailed disks, and highspeed interconnects, for communicating between processing devices.Examples of platform-specific distributed processing systems includeIBM® Corporation's S/390® Parallel Sysplex®, Compaq's Tandem DivisionHimalaya servers, Compaq's Digital Equipment Corporation™ (DEC™)Division OpenVMS™ Cluster software, and Microsoft® Corporation WindowsNT® cluster services (Wolfpack).

FIG. 2b illustrates a transaction processing (TP) architecture 220. Inparticular, TP architecture 220 illustrates a BEA® Systems, Inc. TUXEDO®architecture. TP monitor 224 is coupled to processing devices ATM 221,PC 222, and TP monitor 223 by communication medium 280, 281, and 282,respectively. ATM 221 may be an automated teller machine, PC 222 may bea personal computer, and TP monitor 223 may be another transactionprocessor monitor. TP monitor 224 is coupled to back-end servers 225,226, and 227 by communication mediums 283, 284, and 285. Server 225 iscoupled to persistent storage device 287, storing database 289, bycommunication medium 286. TP monitor 224 includes a workflow controller224 a for routing service requests from processing devices, such as ATM221, PC 222, or TP monitor 223, to various servers such as server 225,226 and 227. Work flow controller 224 a enables (1) workload balancingbetween servers, (2) limited scalability or allowing for additionalservers and/or clients, (3) fault tolerance of redundant backend servers(or a service request may be sent by a workflow controller to a serverwhich has not failed), and (4) session concentration to limit the numberof simultaneous connections to back-end servers. Examples of othertransaction processing architectures include IBM® Corporation's CICS®,Compaq's Tandem Division Pathway/Ford/TS, Compaq's DEC™ ACMS, andTransarc Corporation's Encina.

TP architecture 220 also has many disadvantages. First, a failure of asingle processing device or TP monitor 224 may render the networkinoperable. Second, the scalability or number of processing devices(both servers and clients) coupled to TP monitor 224 may be limited byTP monitor 224 hardware and software. Third, flexibility in routing aclient request to a server is limited. For example, if communicationmedium 280 is inoperable, but communication medium 290 becomesavailable, ATM 221 typically may not request service directly fromserver 225 over communication medium 290 and must access TP monitor 224.Fourth, a client typically does not know the state of a back-end serveror other processing device. Fifth, no industry standard software or APIsare used for load balancing. And sixth, a client typically may notselect a particular server even if the client has relevant informationwhich would enable efficient service.

Therefore, it is desirable to provide a distributed processing systemand, in particular, distributed processing system software that has theadvantages of the prior art distributed processing systems without theinherent disadvantages. The software should allow for industry standardAPIs which are typically used in either client/server, multi-tier, orpeer-to-peer distributed processing systems. The software should supporta variety of computer programming models. Further, the software shouldenable (1) enhanced fault tolerance, (2) efficient scalability, (3)effective load balancing, and (4) session concentration control. Theimproved computer software should allow for rerouting or networkreconfiguration. Also, the computer software should allow for thedetermination of the state of a processing device.

SUMMARY OF THE INVENTION

An improved distributed processing system is provided and, inparticular, computer software for a distributed processing system isprovided. The computer software improves the fault tolerance of thedistributed processing system as well as enables efficient scalability.The computer software allows for efficient load balancing and sessionconcentration. The computer software supports rerouting orreconfiguration of a computer network. The computer software supports avariety of computer programming models and allows for the use ofindustry standard APIs that are used in both client/server andpeer-to-peer distributed processing architectures. The computer softwareenables a determination of the state of a server or other processingdevice. The computer software also supports message forwarding under avariety of circumstances, including a security model.

According to one aspect of the present invention, a distributedprocessing system comprises a communication medium coupled to a firstprocessing device and a second processing device. The first processingdevice includes a first software program emulating a processing device(“JVM1”) including a first kernel software layer having a data structure(“RJVM1”). The second processing device includes a first softwareprogram emulating a processing device (“JVM2”) including a first kernelsoftware layer having a data structure (“RJVM2”). A message from thefirst processing device is transferred to the second processing devicethrough the first kernel software layer and the first software programin the first processing device to the first kernel software layer andthe first software program in the second processing device.

According to another aspect of the present invention, the first softwareprogram in the first processing device is a Java™ virtual machine(“JVM”) and the data structure in the first processing device is aremote Java™ virtual machine (“RJVM”). Similarly, the first softwareprogram in the second processing device is a JVM and the data structurein the second processing device is a RJVM. The RJVM in the secondprocessing device corresponds to the JVM in the first processing device.

According to another aspect of the present invention, the RJVM in thefirst processing device includes a socket manager software component, athread manager software component, a message routing software component,a message compression software component, and/or a peer-gone detectionsoftware component.

According to another aspect of the present invention, the firstprocessing device communicates with the second processing device using aprotocol selected from the group consisting of Transmission ControlProtocol (“TCP”), Secure Sockets Layer (“SSL”), Hypertext TransportProtocol (“HTTP”) tunneling, and Internet InterORB Protocol (“IIOP”)tunneling.

According to another aspect of the present invention, the firstprocessing device includes memory storage for a Java™ application.

According to another aspect of the present invention, the firstprocessing device is a peer of the second processing device. Also, thefirst processing device is a server and the second processing device isa client.

According to another aspect of the present invention, a secondcommunication medium is coupled to the second processing device. A thirdprocessing device is coupled to the second communication medium. Thethird processing device includes a first software program emulating aprocessing device (“JVM3”), including a kernel software layer having afirst data structure (“RJVM1”), and a second data structure (“RJVM2”).

According to still another aspect of the present invention, the firstprocessing device includes a stub having a replica-handler softwarecomponent. The replica-handler software component includes a loadbalancing software component and a failover software component.

According to another aspect of the present invention, the firstprocessing device includes an Enterprise Java™ Bean object.

According to still another aspect of the present invention, the firstprocessing device includes a naming tree having a pool of stubs storedat a node of the tree and the second processing device includes aduplicate of the naming tree.

According to still another aspect of the present invention, the firstprocessing device includes an application program coded in a statelessprogram model and the application program includes a stateless sessionbean.

According to still another aspect of the present invention, the firstprocessing device includes an application program coded in a statelessfactory program model and the application program includes a statefulsession bean.

According to still another aspect of the present invention, the firstprocessing device includes an application program coded in a statefulprogram model and the application program includes an entity sessionbean.

According to still another aspect of the present invention, an articleof manufacture including an information storage medium is provided. Thearticle of manufacture comprises a first set of digital information fortransferring a message from a RJVM in a first processing device to aRJVM in a second processing device.

According to another aspect of the present invention, the article ofmanufacture comprises a first set of digital information, including astub having a load balancing software program for selecting a serviceprovider from a plurality of service providers.

According to another aspect of the present invention, the stub has afailover software component for removing a failed service provider fromthe plurality of service providers.

According to another aspect of the present invention, the load balancingsoftware component selects a service provider based on an affinity for aparticular service provider.

According to another aspect of the present invention, the load balancingsoftware component selects a service provider in a round robin manner.

According to another aspect of the present invention, the load balancingsoftware component randomly selects a service provider.

According to another aspect of the present invention, the load balancingsoftware component selects a service provider from the plurality ofservice providers based upon the load of each service provider.

According to another aspect of the present invention, the load balancingsoftware component selects a service provider from the plurality ofservice providers based upon the data type requested.

According to another aspect of the present invention, the load balancingsoftware component selects a service provider from the plurality ofservice providers based upon the closest physical service provider.

According to another aspect of the present invention, the load balancingsoftware component selects a service provider from the plurality ofservice providers based upon a time period in which each serviceprovider responds.

According to another aspect of the present invention, the article ofmanufacture comprises a first set of digital information, including anEnterprise Java™ Bean object for selecting a service provider from aplurality of service providers.

According to another aspect of the present invention, a stub is storedin a processing device in a distributed processing system. The stubincludes a method comprising the steps of obtaining a list of serviceproviders and selecting a service provider from the list of serviceproviders.

According to another aspect of the present invention, the method furtherincludes removing a failed service provider from the list of serviceproviders.

According to still another aspect of the present invention, an apparatuscomprises a communication medium coupled to a first processing deviceand a second processing device. The first processing device stores anaming tree including a remote method invocation (“RMI”) stub foraccessing a service provider. The second processing device has aduplicate naming tree and the service provider.

According to another aspect of the present invention, the naming treehas a node including a service pool of current service providers.

According to another aspect of the present invention, the service poolincludes a stub.

According to another aspect of the present invention, a distributedprocessing system comprises a first computer coupled to a secondcomputer. The first computer has a naming tree, including a remoteinvocation stub for accessing a service provider. The second computerhas a replicated naming tree and the service provider.

According to another aspect of the present invention, a distributedprocessing system comprising a first processing device coupled to asecond processing device is provided. The first processing device has aJVM and a first kernel software layer including a first RJVM. The secondprocessing device includes a first JVM and a first kernel software layerincluding a second RJVM. A message may be transferred from the firstprocessing device to the second processing device when there is not asocket available between the first JVM and the second JVM.

According to another aspect of the present invention, the firstprocessing device is running under an applet security model, behind afirewall or is a client, and the second processing device is also aclient.

Other aspects and advantages of the present invention can be seen uponreview of the figures, the detailed description, and the claims whichfollow.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1a illustrates a prior art client/server architecture;

FIG. 1b illustrates a prior art Java™ enterprise APIs;

FIG. 1c illustrates a multi-tier architecture;

FIG. 2a illustrates a prior art peer-to-peer architecture;

FIG. 2b illustrates a prior art transaction processing architecture;

FIG. 3a illustrates a simplified software block diagram of an embodimentof the present invention;

FIG. 3b illustrates a simplified software block diagram of the kernelillustrated in FIG. 3a;

FIG. 3c illustrates a clustered enterprise Java™ architecture;

FIG. 4 illustrates a clustered enterprise Java™ naming servicearchitecture;

FIG. 5a illustrates a smart stub architecture;

FIG. 5b illustrates an EJB object architecture;

FIG. 6a is a control flow chart illustrating a load balancing method;

FIGS. 6b-g are control flow charts illustrating load balancing methods;

FIG. 7 is a control flow chart illustrating a failover method;

FIG. 8 illustrates hardware and software components of a client/serverin the clustered enterprise Java™ architecture shown in FIGS. 3-5.

The invention will be better understood with reference to the drawingsand detailed description below. In the drawings, like reference numeralsindicate like components.

DETAILED DESCRIPTION

I. Clustered Enterprise Java™ Distributed Processing System

A. Clustered Enterprise Java™ Software Architecture

FIG. 3a illustrates a simplified block diagram 380 of the softwarelayers in a processing device of a clustered enterprise Java™ system,according to an embodiment of the present invention. A detaileddescription of a clustered enterprise Java™ distributed processingsystem is described below. The first layer of software includes acommunication medium software driver 351 for transferring and receivinginformation on a communication medium, such as an ethernet local areanetwork. An operating system 310 including a transmission controlprotocol (“TCP”) software component 353 and internet protocol (“IP”)software component 352 are upper software layers for retrieving andsending packages or blocks of information in a particular format. An“upper” software layer is generally defined as a software componentwhich utilizes or accesses one or more “lower” software layers orsoftware components. A JVM 354 is then implemented. A kernel 355 havinga remote Java™ virtual machine 356 is then layered on JVM 354. Kernel355. described in detail below, is used to transfer messages betweenprocessing devices in a clustered enterprise Java™ distributedprocessing system. Remote method invocation 357 and enterprise Java™bean 358 are upper software layers of kernel 355. EJB 358 is a containerfor a variety of Java™ applications.

FIG. 3b illustrates a detailed view of kernel 355 illustrated in FIG.3a. Kernel 355 includes a socket manager component 363, thread manager364 component, and RJVM 356. RJVM 356 is a data structure includingmessage routing software component 360, message compression softwarecomponent 361 including abbreviation table 161 c, and peer-gonedetection software component 362. RJVM 356 and thread manager component364 interact with socket manager component 363 to transfer informationbetween processing devices.

B. Distributed Processing System

FIG. 3 illustrates a simplified block diagram of a clustered enterpriseJava™ distributed processing system 300. Processing devices are coupledto communication medium 301. Communication medium 301 may be a wiredand/or wireless communication medium or combination thereof. In anembodiment, communication medium 301 is a local-area-network (LAN). Inan alternate embodiment, communication medium 301 is aworld-area-network (WAN) such as the Internet or World Wide Web. Instill another embodiment, communication medium 301 is both a LAN and aWAN.

A variety of different types of processing devices may be coupled tocommunication medium 301. In an embodiment, a processing device may be ageneral purpose computer 100 as illustrated in FIG. 8 and describedbelow. One of ordinary skill in the art would understand that FIG. 8 andthe below description describes one particular type of processing devicewhere multiple other types of processing devices with a differentsoftware and hardware configurations could be utilized in accordancewith an embodiment of the present invention. In an alternate embodiment,a processing device may be a printer, handheld computer, laptopcomputer, scanner, cellular telephone, pager, or equivalent thereof.

FIG. 3c illustrates an embodiment of the present invention in whichservers 302 and 303 are coupled to communication medium 301. Server 303is also coupled to communication medium 305 which may have similarembodiments as described above in regard to communication medium 301.Client 304 is also coupled to communication medium 305. In an alternateembodiment, client 304 may be coupled to communication medium 301 asillustrated by the dashed line and box in FIG. 3c. It should beunderstood that in alternate embodiments, server 302 is (1) both aclient and a server, or (2) a client. Similarly, FIG. 3 illustrates anembodiment in which three processing devices are shown wherein otherembodiments of the present invention include multiple other processingdevices or communication mediums as illustrated by the ellipses.

Server 302 transfers information over communication medium 301 to server303 by using network software 302 a and network software 303 a,respectively. In an embodiment, network software 302 a, 303 a, and 304 ainclude communication medium software driver 351, Transmission ControlProtocol software 353, and Internet Protocol software 352 (“TCP/IP”).Client 304 also includes network software 304 a for transferringinformation to server 303 over communication medium 305. Networksoftware 303 a in server 303 is also used to transfer information toclient 304 by way of communication medium 305.

According to an embodiment of the present invention, each processingdevice in clustered enterprise Java™ architecture 300 includes amessage-passing kernel 355 that supports both multi-tier andpeer-to-peer functionality. A kernel is a software program used toprovide fundamental services to other software programs on a processingdevice.

In particular, server 302, server 303, and client 304 have kernels 302b, 303 b, and 304 b, respectively. In particular, in order for two JVMsto interact, whether they are clients or servers, each JVM constructs anRJVM representing the other. Messages are sent from the upper layer onone side, through a corresponding RJVM, across the communication medium,through the peer RJVM, and delivered to the upper layer on the otherside. In various embodiments, messages can be transferred using avariety of different protocols, including, but not limited to,Transmission Control Protocol/Internet Protocol (“TCP/IP”), SecureSockets Layer (“SSL”), Hypertext Transport Protocol (“HTTP”) tunneling,and Internet InterORB Protocol (“IIOP”) tunneling, and combinationsthereof. The RJVMs and socket managers create and maintain the socketsunderlying these protocols and share them between all objects in theupper layers. A socket is a logical location representing a terminalbetween processing devices in a distributed processing system. Thekernel maintains a pool of execute threads and thread manager softwarecomponent 364 multiplexes the threads between socket reading and requestexecution. A thread is a sequence of executing program code segments orfunctions.

For example, server 302 includes JVM1 and Java™ application 302 c.Server 302 also includes a RJVM2 representing the JVM2 of server 303. Ifa message is to be sent from server 302 to server 303, the message issent through RJVM2 in server 302 to RJVM1 in server 303.

C. Message Forwarding

Clustered enterprise Java™ network 300 is able to forward a messagethrough an intermediate server. This functionality is important if aclient requests a service from a back-end server through a front-endgateway. For example, a message from server 302 (client 302) and, inparticular, JVM1 may be forwarded to client 304 (back-end server 304) orJVM3 through server 303 (front-end gateway) or JVM2. This functionalityis important in controlling session concentration or how manyconnections are established between a server and various clients.

Further, message forwarding may be used in circumstances where a socketcannot be created between two JVMs. For example, a sender of a messageis running under the applet security model which does not allow for asocket to be created to the original server. A detailed description ofthe applet security model is provided at http//:www.javasoft.com, whichis incorporated herein by reference. Another example includes when thereceiver of the message is behind a firewall. Also, as described below,message forwarding is applicable if the sender is a client and thereceiver is a client and thus does not accept incoming sockets.

For example, if a message is sent from server 302 to client 304, themessage would have to be routed through server 303. In particular, amessage handoff, as illustrated by 302 f, between RJVM3 (representingclient 304) would be made to RJVM2 (representing server 303) in server302. The message would be transferred using sockets 302 e between RJVM2in server 302 and RJVM1 in server 303. The message would then be handedoff, as illustrated by dashed line 303 f, from RJVM1 to RJVM3 in server303. The message would then be passed between sockets of RJVM3 in server303 and RJVM2 in client 304. The message then would be passed, asillustrated by the dashed line 304 f, from RJVM2 in client 304 to RJVM1in client 304.

D. Rerouting

An RJVM in client/server is able to switch communication paths orcommunication mediums to other RJVMs at any time. For example, if client304 creates a direct socket to server 302, server 302 is able to startusing the socket instead of message forwarding through server 303. Thisembodiment is illustrated by a dashed line and box representing client304. In an embodiment, the use of transferring messages by RJVMs ensuresreliable, in-order message delivery after the occurrence of a networkreconfiguration. For example, if client 304 was reconfigured tocommunication medium 301 instead of communication medium 305 asillustrated in FIG. 3. In an alternate embodiment, messages may not bedelivered in order.

An RJVM performs several end-to-end operations that are carried throughrouting. First, an RJVM is responsible for detecting when a respectiveclient/server has unexpectedly died. In an embodiment, peer-goneselection software component 362, as illustrated in FIG. 3b, isresponsible for this function. In an embodiment, an RJVM sends aheartbeat message to other clients/servers when no other message hasbeen sent in a predetermined time period. If the client/server does notreceive a heartbeat message in the predetermined count time, a failedclient/server which should have sent the heartbeat, is detected. In anembodiment, a failed client/server is detected by connection timeouts orif no messages have been sent by the failed client/server in apredetermined amount of time. In still another embodiment, a failedsocket indicates a failed server/client.

Second, during message serialization, RJVMs, in particular, messagecompression software 360, abbreviate commonly transmitted data values toreduce message size. To accomplish this, each JVM/RJVM pair maintainsmatching abbreviation tables. For example, JVM1 includes an abbreviationtable and RJVM1 includes a matching abbreviation table. During messageforwarding between an intermediate server, the body of a message is notdeserialized on the intermediate server in route.

E. Multi-tier/Peer-to-Peer Functionality

Clustered enterprise Java™ architecture 300 allows for multitier andpeer-to-peer programming.

Clustered enterprise Java™ architecture 300 supports an explicit syntaxfor client/server programming consistent with a multitier distributedprocessing architecture. As an example, the following client-side codefragment writes an informational message to a server's log file:

T3Client clnt=new T3Client(“t3://acme:7001”);

LogServices log=clnt.getT3Services( ).log( );

log.info(“Hello from a client”);

The first line establishes a session with the acme server using the t3protocol. If RJVMs do not already exist, each JVM constructs an RJVM forthe other and an underlying TCP socket is established. The client-siderepresentation of this session—the T3Client object—and the server-siderepresentation communicate through these RJVMs. The server-side supportsa variety of services, including database access, remote file access,workspaces, events, and logging. The second line obtains a LogServicesobject and the third line writes the message.

Clustered enterprise Java™ computer architecture 300 also supports aserver-neutral syntax consistent with a peer-to-peer distributedprocessing architecture. As an example, the following code fragmentobtains a stub for an RMI object from the JNDI-compliant naming serviceon a server and invokes one of its methods.

Hashtable env=new Hashtable( );

env.put(Context.PROVIDER_URL, “t3://acme:7001”);

env.put(Context.INITIAL_CONTEXT_FACTORY,

“weblogic.jndi.WebLogicinitialContextFactory”);

Context ctx=new InitialContext(env);

Example e=(Example) ctx.lookup(“acme.eng.example”);

result=e.example(37);

In an embodiment, JNDI naming contexts are packaged as RMI objects toimplement remote access. Thus, the above code illustrates a kind of RMIbootstrapping. The first four lines obtain an RMI stub for the initialcontext on the acme server. If RJVMs do not already exist, each sideconstructs an RJVM for the other and an underlying TCP socket for the t3protocol is established. The caller-side object—the RMI stub—and thecallee-side object—an RMI impl-communicate through the RJVMs. The fifthline looks up another RMI object, an Example, at the nameacme.eng.example and the sixth line invokes one of the Example methods.In an embodiment, the Example impI is not on the same processing deviceas the naming service. In another embodiment, the Example impI is on aclient. Invocation of the Example object leads to the creation of theappropriate RJVMs if they do not already exist.

II. Replica-Aware or Smart Stubs/EJB Objects

In FIG. 3c, a processing device is able to provide a service to otherprocessing devices in architecture 300 by replicating RMI and/or EJBobjects. Thus, architecture 300 is easily scalable and fault tolerant.An additional service may easily be added to architecture 300 by addingreplicated RMI and/or EJB objects to an existing processing device ornewly added processing device. Moreover, because the RMI and/or EJBobjects can be replicated throughout architecture 300, a singleprocessing device, multiple processing devices, and/or a communicationmedium may fail and still not render architecture 300 inoperable orsignificantly degraded.

FIG. 5a illustrates a replica-aware (“RA”) or Smart stub 580 inarchitecture 500. Architecture 500 includes client 504 coupled tocommunication medium 501. Servers 502 and 503 are coupled tocommunication medium 501, respectively. Persistent storage device 509 iscoupled to server 502 and 503 by communication medium 560 and 561,respectively. In various embodiments, communication medium 501, 560, and561 may be wired and/or wireless communication mediums as describedabove. Similarly, in an embodiment, client 504, server 502, and server503 may be both clients and servers as described above. One of ordinaryskill in the art would understand that in alternate embodiments,multiple other servers and clients may be included in architecture 500as illustrated by ellipses. Also, as stated above, in alternateembodiments, the hardware and software configuration of client 504,server 502 and server 503 is described below and illustrated in FIG. 8.

RA RMI stub 580 is a Smart stub which is able to find out about all ofthe service providers and switch between them based on a load balancingmethod 507 and/or failover method 508. In an embodiment, an RA stub 580includes a replica handler 506 that selects an appropriate loadbalancing method 507 and/or failover method 507. In an alternateembodiment, a single load balancing method and/or single failover methodis implemented. In alternate embodiments, replica handler 506 mayinclude multiple load balancing methods and/or multiple failover methodsand combinations thereof. In an embodiment, a replica handler 506implements the following interface:

public interface ReplicaHandler {

Object loadBalance(Object currentProvider) throws

RefreshAbortedException;

Object failOver(Object failedProvider,

RemoteException e) throws

RemoteException;

}

Immediately before invoking a method, RA stub 580 calls load balancemethod 507, which takes the current server and returns a replacement.For example, client 504 may be using server 502 for retrieving data fordatabase 509 a or personal storage device 509. Load balance method 507may switch to server 503 because server 502 is overloaded with servicerequests. Handler 506 may choose a server replacement entirely on thecaller, perhaps using information about server 502 load, or handler 506may request server 502 for retrieving a particular type of data. Forexample, handler 506 may select a particular server for calculating anequation because the server has enhanced calculation capability. In anembodiment, replica handler 506 need not actually switch providers onevery invocation because replica handler 506 is trying to minimize thenumber of connections that are created.

FIG. 6a is a control flow diagram illustrating the load balancingsoftware 507 illustrated in FIGS. 5a-b. It should be understood thatFIG. 6a is a control flow diagram illustrating the logical sequence offunctions or steps which are completed by software in load balancingmethod 507. In alternate embodiments, additional functions or steps arecompleted. Further, in an alternate embodiment, hardware may perform aparticular function or all the functions.

Load balancing software 507 begins as indicated by circle 600. Adetermination is then made in logic block 601 as to whether the callingthread established “an affinity” for a particular server. A client hasan affinity for the server that coordinates its current transaction anda server has an affinity for itself. If an affinity is established,control is passed to logic block 602, otherwise control is passed tologic block 604. A determination is made in logic block 602 whether theaffinity server provides the service requested. If so, control is passedto logic block 603. Otherwise, control is passed to logic block 604. Theprovider of the service on the affinity server is returned to the clientin logic block 603. In logic block 604, a naming service is contactedand an updated list of the current service providers is obtained. AgetNextProvider method is called to obtain a service provider in logicblock 605. Various embodiments of the getNextProvider method areillustrated in FIGS. 6b-g and described in detail below. The service isobtained in logic block 606. Failover method 508 is then called ifservice is not provided in logic block 606 and load balancing method 507exits as illustrated by logic block 608. An embodiment of failovermethod 508 is illustrated in FIG. 7 and described in detail below.

FIGS. 6b-g illustrate various embodiments of a getNextProvider methodused in logic block 605 of FIG. 6a. As illustrated in FIG. 6b, thegetNextProvider method selects a service provider in a round robinmanner. A getNextProvider method 620 is entered as illustrated by circle621. A list of current service providers is obtained in logic block 622.A pointer is incremented in logic block 623. The next service provideris selected based upon the pointer in logic block 624 and the newservice provider is returned in logic block 625 and getNextProvidermethod 620 exits as illustrated by circle 626.

FIG. 6c illustrates an alternate embodiment of a getNextProvider methodwhich obtains a service provider by selecting a service providerrandomly. A getNextProvider method 630 is entered as illustrated bycircle 631. A list of current service providers is obtained asillustrated by logic block 632. The next service provider is selectedrandomly as illustrated by logic block 633 and a new service provider isreturned in logic block 634. The getNextProvider method 630 then exits,as illustrated by circle 635.

Still another embodiment of a getNextProvider method is illustrated inFIG. 6d which obtains a service provider based upon the load of theservice providers. A getNextProvider method 640 is entered asillustrated by circle 641. A list of current service providers isobtained in logic block 642. The load of each service provider isobtained in logic block 643. The service provider with the least load isthen selected in logic block 644. The new service provider is thenreturned in logic block 645 and getNextProvider method 640 exits asillustrated by circle 646.

An alternate embodiment of a getNextProvider method is illustrated inFIG. 6e which obtains a service provider based upon the type of dataobtained from the service provider. A getNextProvider method 650 isentered as illustrated by circle 651. A list of current serviceproviders is obtained in logic block 652. The type of data requestedfrom the service providers is determined in logic block 653. The serviceprovider is then selected based on the data type in logic block 654. Theservice provider is returned in logic block 655 and getNextProvidermethod 650 exits as illustrated by circle 656.

Still another embodiment of a getNextProvider method is illustrated inFIG. 6f which selects a service provider based upon the physicallocation of the service providers. A getNextProvider method 660 isentered as illustrated by circle 661. A list of service providers isobtained as illustrated by logic block 662. The physical distance toeach service provider is determined in logic block 663 and the serviceprovider which has the closest physical distance to the requestingclient is selected in logic block 664. The new service provider is thenreturned in logic block 665 and the getNextProvider method 660 exits asillustrated by circle 666.

Still a further embodiment of the getNextProvider method is illustratedin FIG. 6g and selects a service provider based on the amount of timetaken for the service provider to respond to previous requests. Controlof getNextProvider method 670 is entered as illustrated by circle 671. Alist of current service providers is obtained in logic block 672. Thetime period for each service provider to respond to a particular messageis determined in logic block 673. The service provider which responds inthe shortest time period is selected in logic block 674. The new serviceprovider is then returned in logic block 675 and control fromgetNextProvider method 670 exits as illustrated by circle 676.

If invocation of a service method fails in such a way that a retry iswarranted, RA 580 stub calls failover method 508, which takes the failedserver and an exception indicating what the failure was and returns anew server for the retry. If a new server is unavailable, RA stub 580throws an exception.

FIG. 7 is a control flow chart illustrating failover software 508 shownin FIGS. 5a-b. Failover method 508 is entered as illustrated by circle700. A failed provider from the list of current providers of services isremoved in logic block 701. A getNextProvider method is then called inorder to obtain a service provider. The new service provider is thenreturned in logic block 703 and failover method 508 exits as illustratedby circle 704.

While FIGS. 6-7 illustrate embodiments of a replica handler 506,alternate embodiments include the following functions or combinationsthereof implemented in a round robin manner.

First, a list of servers or service providers of a service ismaintained. Whenever the list needs to be used and the list has not beenrecently updated, handler 506 contacts a naming service as describedbelow and obtains an up-to-date list of providers.

Second, if handler 506 is about to select a provider from the list andthere is an existing RJVM-level connection to the hosting server overwhich no messages have been received during the last heartbeat period,handler 506 skips that provider. In an embodiment, a server may laterrecover since death of peer is determined after several such heartbeatperiods. Thus, load balancing on the basis of server load is obtained.

Third, when a provider fails, handler 506 removes the provider from thelist. This avoids delays caused by repeated attempts to use non-workingservice providers.

Fourth, if a service is being invoked from a server that hosts aprovider of the service, then that provider is used. This facilitatesco-location of providers for chained invokes of services.

Fifth, if a service is being invoked within the scope of a transactionand the server acting as transaction coordinator hosts a provider of theservice, then that provider is used. This facilitates co-location ofproviders within a transaction.

The failures that can occur during a method invocation may be classifiedas being either (1) application-related, or (2) infrastructure-related.RA stub 580 will not retry an operation in the event of anapplication-related failure, since there can be no expectation thatmatters will improve. In the event of an infrastructure-related failure,RA stub 580 may or may not be able to safely retry the operation. Someinitial non-idempotent operation, such as incrementing the value of afield in a database, might have completed. In an embodiment, RA stub 580will retry after an infrastructure failure only if either (1) the userhas declared that the service methods are idempotent, or (2) the systemcan determine that processing of the request never started. As anexample of the latter, RA stub 580 will retry if, as part of loadbalancing method, stub 580 switches to a service provider whose host hasfailed. As another example, a RA stub 580 will retry if it gets anegative acknowledgment to a transactional operation.

A RMI compiler recognizes a special flag that instructs the compiler togenerate an RA stub for an object. An additional flag can be used tospecify that the service methods are idempotent. In an embodiment, RAstub 580 will use the replica handler described above and illustrated inFIG. 5a. An additional flag may be used to specify a different handler.In addition, at the point a service is deployed, i.e., bound into aclustered naming service as described below, the handler may beoverridden.

FIG. 5b illustrates another embodiment of the present invention in whichan EJB object 551 is used instead of a stub, as shown in FIG. 5a.

III. Replicated JNDI-compliant Naming Service

As illustrated in FIG. 4, access to service providers in architecture400 is obtained through a JNDI-compliant naming service, which isreplicated across architecture 400 so there is no single point offailure. Accordingly, if a processing device which offers aJNDI-compliant naming service fails, another processing device having areplicated naming service is available. To offer an instance of aservice, a server advertises a provider of the service at a particularnode in a replicated naming tree. In an embodiment, each server adds aRA stub for the provider to a compatible service pool stored at the nodein the server's copy of the naming tree. If the type of a new offer isincompatible with the type of offers in an existing pool, the new offeris made pending and a callback is made through a ConflictHandlerinterface. After either type of offer is retracted, the other willultimately be installed everywhere. When a client looks up the service,the client obtains a RA stub that contacts the service pool to refreshthe client's list of service providers.

FIG. 4 illustrates a replicated naming service in architecture 400. Inan embodiment, servers 302 and 303 offer an example service provider P1and P2, respectively, and has a replica of the naming service tree 402and 403, respectively. The node acme.eng.example in naming service tree402 and 403 has a service pool 402 a and 403 a, respectively, containinga reference to Example service provider P1 and P2. Client 304 obtains aRA stub 304 e by doing a naming service lookup at the acme.eng.examplenode. Stub 304 e contacts an instance of a service pool to obtain acurrent list of references to available service providers. Stub 304 emay switch between the instances of a service pool as needed forload-balancing and failover.

Stubs for the initial context of the naming service are replica-aware orSmart stubs which initially load balance among naming service providersand switch in the event of a failure. Each instance of the namingservice tree contains a complete list of the current naming serviceproviders. The stub obtains a fresh list from the instance it iscurrently using. To bootstrap this process, the system uses DomainNaming Service (“DNS”) to find a (potentially incomplete) initial listof instances and obtains the complete list from one of them. As anexample, a stub for the initial context of the naming service can beobtained as follows:

Hashtable env=new Hashtable( );

env.put(Context.PROVIDER_URL, “t3://acmeCluster:7001”);

env.put(Context.INITIAL_CONTEXT_FACTORY,

“weblogic.jndi.WebLogicInitialContextFactor”);

Context ctx=new InitialContext(env);

Some subset of the servers in an architecture have been bound into DNSunder the name acmeCluster. Moreover, an application is still able tospecify the address of an individual server, but the application willthen have a single point of failure when the application first attemptsto obtain a stub.

A reliable multicast protocol is desirable. In an embodiment, providerstubs are distributed and replicated naming trees are created by an IPmulticast or point-to-point protocol. In an IP multicast embodiment,there are three kinds of messages: Heartbeats, Announcements, andStateDumps. Heartbeats are used to carry information between serversand, by their absence, to identify failed servers. An Announcementcontains a set of offers and retractions of services. The Announcementsfrom each server are sequentially numbered. Each receiver processes anAnnouncement in order to identify lost Announcements. Each serverincludes in its Heartbeats the sequence number of the last Announcementit has sent. Negative Acknowledgments (“NAKs”) for a lost Announcementare included in subsequent outgoing Heartbeats. To process NAKs, eachserver keeps a list of the last several Announcements that the serverhas sent. If a NAK arrives for an Announcement that has been deleted,the server sends a StateDump, which contains a complete list of theserver's services and the sequence number of its next Announcement. Whena new server joins an existing architecture, the new server NAKs for thefirst message from each other server, which results in StateDumps beingsent. If a server does not receive a Heartbeat from another server aftera predetermined period of time, the server retracts all services offeredby the server not generating a Heartbeat.

IV. Programming Models

Applications used in the architecture illustrated in FIGS. 3-5 use oneof three basic programming models: (1) stateless or direct, (2)stateless factory or indirect, or (3) stateful or targeted, depending onthe way the application state is to be treated. In the stateless model,a Smart stub returned by a naming-service lookup directly referencesservice providers.

Example e=(Example) ctx.lookup(“acme.eng.example”);

result1=e.example(37);

result2=e.example(38);

In this example, the two calls to example may be handled by differentservice providers since the Smart stub is able to switch between them inthe interests of load balancing. Thus, the Example service object cannotinternally store information on behalf of the application. Typically thestateless model is used only if the provider is stateless. As anexample, a pure stateless provider might compute some mathematicalfunction of its arguments and return the result. Stateless providers maystore information on their own behalf, such as for accounting purposes.More importantly, stateless providers may access an underlyingpersistent storage device and load application state into memory on anas-needed basis. For example, in order for example to return the runningsum of all values passed to it as arguments, example might read theprevious sum from a database, add in its current argument, write the newvalue out, and then return it. This stateless service model promotesscalability.

In the stateless factory programming model, the Smart stub returned bythe lookup is a factory that creates the desired service providers,which are not themselves Smart stubs.

ExampleFactory gf=(ExampleFactory)

ctx.lookup(“acme.eng.example”);

Example e=gf.create( );

result1=e.example(37);

result2=e.example(38);

In this example, the two calls to example are guaranteed to be handledby the same service provider. The service provider may therefore safelystore information on behalf of the application. The stateless factorymodel should be used when the caller needs to engage in a “conversation”with the provider. For example, the caller and the provider might engagein a back-and-forth negotiation. Replica-aware stubs are generally thesame in the stateless and stateless factory models, the only differenceis whether the stubs refer to service providers or service providerfactories.

A provider factory stub may failover at will in its effort to create aprovider, since this operation is idempotent. To further increase theavailability of an indirect service, application code must contain anexplicit retry loop around the service creation and invocation.

while (true) {

try {

Example e=gf.create( );

result1:=e.example(37);

result2=e.example(38);

break;

} catch (Exception e) {

if (!retryWarranted(e))

throw e;

}

}

This would, for example, handle the failure of a provider e that wassuccessfully created by the factory. In this case, application codeshould determine whether non-idempotent operations completed. To furtherincrease availability, application code might attempt to undo suchoperations and retry.

In the stateful programming model, a service provider is a long-lived,stateful object identified by some unique system-wide key. Examples of“entities” that might be accessed using this model include remote filesystems and rows in a database table. A targeted provider may beaccessed many times by many clients, unlike the other two models whereeach provider is used once by one client. Stubs for targeted providerscan be obtained either by direct lookup, where the key is simply thenaming-service name, or through a factory, where the key includesarguments to the create operation. In either case, the stub will not doload balancing or failover. Retries, if any, must explicitly obtain thestub again.

There are three kinds of beans in EJB, each of which maps to one of thethree programming models. Stateless session beans are created on behalfof a particular caller, but maintain no internal state between calls.Stateless session beans map to the stateless model. Stateful sessionbeans are created on behalf of a particular caller and maintain internalstate between calls. Stateful session beans map to the stateless factorymodel. Entity beans are singular, stateful objects identified by asystem-wide key. Entity beans map to the stateful model. All three typesof beans are created by a factory called an EJB home. In an embodiment,both EJB homes and the beans they create are referenced using RMI. In anarchitecture as illustrated in FIGS. 3-5, stubs for an EJB home areSmart stubs. Stubs for stateless session beans are Smart stubs, whilestubs for stateful session beans and entity beans are not. The replicahandler to use for an EJB-based service can be specified in itsdeployment descriptor.

To create an indirect RMI-based service, which is required if the objectis to maintain state on behalf of the caller, the application code mustexplicitly construct the factory. A targeted RMI-based service can becreated by running the RMI compiler without any special flags and thenbinding the resulting service into the replicated naming tree. A stubfor the object will be bound directly into each instance of the namingtree and no service pool will be created. This provides a targetedservice where the key is the naming-service name. In an embodiment, thisis used to create remote file systems.

V. Hardware and Software Components

FIG. 8 shows hardware and software components of an exemplary serverand/or client as illustrated in FIGS. 3-5. The system of FIG. 8 includesa general-purpose computer 800 connected by one or more communicationmediums, such as connection 829, to a LAN 840 and also to a WAN, hereillustrated as the Internet 880. Through LAN 840, computer 800 cancommunicate with other local computers, such as a file server 841. In anembodiment, file server 801 is server 303 as illustrated in FIG. 3.Through the Internet 880, computer 800 can communicate with othercomputers, both local and remote, such as World Wide Web server 881. Inan embodiment, Web server 881 is server 303 as illustrated in FIG. 3. Aswill be appreciated, the connection from computer 800 to Internet 880can be made in various ways, e.g., directly via connection 829, orthrough local-area network 840, or by modem (not shown).

Computer 800 is a personal or office computer that can be, for example,a workstation, personal computer, or other single-user or multi-usercomputer system; an exemplary embodiment uses a Sun SPARC-20 workstation(Sun Microsystems, Inc., Mountain View, Calif.). For purposes ofexposition, computer 800 can be conveniently divided into hardwarecomponents 801 and software components 802; however, persons of ordinaryskill in the art will appreciate that this division is conceptual andsomewhat arbitrary, and that the line between hardware and software isnot a hard and fast one. Further, it will be appreciated that the linebetween a host computer and its attached peripherals is not a hard andfast one, and that in particular, components that are consideredperipherals of some computers are considered integral parts of othercomputers. Thus, for example, user I/O 820 can include a keyboard, amouse, and a display monitor, each of which can be considered either aperipheral device or part of the computer itself, and can furtherinclude a local printer, which is typically considered to be aperipheral. As another example, persistent storage 808 can include aCD-ROM (compact disc read-only memory) unit, which can be eitherperipheral or built into the computer.

Hardware components 801 include a processor (CPU) 805, memory 806,persistent storage 808, user I/O 820, and network interface 825 whichare coupled to bus 810. These components are well understood by those ofskill in the art and, accordingly, need be explained only briefly here.

Processor 805 can be, for example, a microprocessor or a collection ofmicroprocessors configured for multiprocessing.

Memory 806 can include read-only memory (ROM), randomaccess memory(RAM), virtual memory, or other memory technologies, singly or incombination. Persistent storage 808 can include, for example, a magnetichard disk, a floppy disk, or other persistent read-write data storagetechnologies, singly or in combination. It can further include mass orarchival storage, such as can be provided by CD-ROM or otherlarge-capacity storage technology. (Note that file server 841 providesadditional storage capability that processor 805 can use.)

User I/O (input/output) hardware 820 typically includes a visual displaymonitor such as a CRT or flat-panel display, an alphanumeric keyboard,and a mouse or other pointing device, and optionally can further includea printer, an optical scanner, or other devices for user input andoutput.

Network I/O hardware 825 provides an interface between computer 800 andthe outside world. More specifically, network I/O 825 lets processor 805communicate via connection 829 with other processors and devices throughLAN 840 and through the Internet 880.

Software components 802 include an operating system 850 and a set oftasks under control of operating system 310, such as a Java™ applicationprogram 860 and, importantly, JVM software 354 and kernel 355. Operatingsystem 310 also allows processor 805 to control various devices such aspersistent storage 808, user I/O 820, and network interface 825.Processor 805 executes the software of operating system 310, application860, JVM 354 and kernel 355 in conjunction with memory 806 and othercomponents of computer system 800. In an embodiment, software 802includes network software 302 a, JVM1, RJVM2 and RJVM3, as illustratedin server 302 of FIG. 3c. In an embodiment, Java™ application program860 is Java™ application 302 c as illustrated in FIG. 3c.

Persons of ordinary skill in the art will appreciate that the system ofFIG. 8 is intended to be illustrative, not restrictive, and that a widevariety of computational, communications, and information devices can beused in place of or in addition to what is shown in FIG. 8. For example,connections through the Internet 880 generally involve packet switchingby intermediate router computers (not shown), and computer 800 is likelyto access any number of Web servers, including but by no means limitedto computer 800 and Web server 881, during a typical Web client session.

The foregoing description of the preferred embodiments of the presentinvention has been provided for the purposes of illustration anddescription. It is not intended to be exhaustive or to limit theinvention to the precise forms disclosed. Obviously, many modificationsand variations will be apparent to practitioners skilled in the art. Theembodiments were chosen and described in order to best explain theprinciples of the invention and its practical applications, therebyenabling others skilled in the art to understand the invention forvarious embodiments and with the various modifications as are suited tothe particular use contemplated. It is intended that the scope of theinvention be defined by the following claims and their equivalents.

What is claimed is:
 1. An article of manufacture including aninformation storage medium wherein is stored information, comprising: afirst set of digital information, including a Java™ virtual machine witha stub having a load balancing software component for selecting aservice provider from a plurality of service providers and a failoversoftware component for removing a failed service provider from a listidentifying the plurality of service providers, wherein the Java™virtual machine with the stub is located on a client processing device,wherein the load balancing software selects a particular serviceprovider, from the list of plurality of service providers, if both anaffinity exists for the particular service provider and the particularservice provider provides a service requested, and, wherein an affinityexists for a particular service provider when that particular serviceprovider, or the server associated with the service provider, iscurrently participating in a transaction between either of the serviceprovider or server and the client processing device.
 2. The article ofmanufacture of claim 1, wherein if no affinity for a service providerexists, or if the particular service provider for which the affinityexists does not provide the service requested, then the load balancingsoftware component selects a service provider from the list of pluralityof service providers in a round robin manner.
 3. The article ofmanufacture of claim 1, wherein if no affinity for a service providerexists, or if the particular service provider for which the affinityexists does not provide the service requested, then the load balancingsoftware component randomly selects a service provider from the list ofservice providers.
 4. The article of manufacture of claim 1, wherein ifno affinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the load balancing software component selects a serviceprovider from the list of service providers based upon the load of eachservice provider.
 5. The article of manufacture of claim 1, wherein ifno affinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the load balancing software component selects a serviceprovider from the list of service providers based upon the data typerequested.
 6. The article of manufacture of claim 1, wherein if noaffinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the load balancing software component selects a serviceprovider from the list of service providers based upon the closestphysical service provider.
 7. The article of manufacture of claim 1,wherein if no affinity for a service provider exists, or if theparticular service provider for which the affinity exists does notprovide the service requested, then the load balancing softwarecomponent selects a service provider from the list of service providersbased upon a time period in which each service provider responds.
 8. Anarticle of manufacture including an information storage medium whereinis stored information, comprising: a first set of digital information,including a Java™ virtual machine with a Java™ bean object for selectinga service provider from a plurality of service providers; wherein theJava™ bean object has a load balancing software component that selects aparticular service provider, from the plurality of service providers, ifboth an affinity exists for the particular service provider and theparticular service provider provides a service requested, and, whereinan affinity exists for a particular service provider when thatparticular service provider, or the server associated with the serviceprovider, is currently participating in a transaction between either ofthe service provider or server and the client processing device.
 9. Thearticle of manufacture of claim 8, wherein the Java™ bean object has afailover software component for removing a failed service provider froma list of service providers.
 10. The article of manufacture of claim 8,wherein if no affinity for a service provider exists, or if theparticular service provider for which the affinity exists does notprovide the service requested, then the load balancing softwarecomponent selects a service provider from the plurality of serviceproviders in a round robin manner.
 11. The article of manufacture ofclaim 8, wherein if no affinity for a service provider exists, or if theparticular service provider for which the affinity exists does notprovide the service requested, then the load balancing softwarecomponent randomly selects a service provider.
 12. The article ofmanufacture of claim 8, wherein if no affinity for a service providerexists, or if the particular service provider for which the affinityexists does not provide the service requested, then the load balancingsoftware component selects a service provider from the plurality ofservice providers based upon the load of each service provider.
 13. Thearticle of manufacture of claim 8, wherein if no affinity for a serviceprovider exists, or if the particular service provider for which theaffinity exists does not provide the service requested, then the loadbalancing software component selects a service provider from theplurality of service providers based upon the data type requested. 14.The article of manufacture of claim 8, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then theload balancing software component selects a service provider from theplurality of service providers based upon the closest physical serviceprovider.
 15. The article of manufacture of claim 8, wherein if noaffinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the load balancing software component selects a serviceprovider from the plurality of service providers based upon a timeperiod in which each service provider responds.
 16. The article ofmanufacture of claim 8, further comprising: a second set of digitalinformation, including a stateless session bean.
 17. The article ofmanufacture of claim 8, further comprising: a second set of digitalinformation, including a stateful session bean.
 18. The article ofmanufacture of claim 8, further comprising: a second set of digitalinformation, including an entity session bean.
 19. An apparatus,comprising: a processor; an instruction store, coupled to the processor,comprising an article of manufacture as recited in claim 1; and a datastore, coupled to the processor, wherein an application program can bestored.
 20. An apparatus, comprising: a processor; an instruction store,coupled to the processor, comprising an article of manufacture asrecited in claim 8; and a data store, coupled to the processor, whereinan application program can be stored.
 21. A processing deviceimplemented method, comprising the steps of: obtaining, by a stub, alist of service providers; and selecting a service provider for use in atransaction, by the stub, from the list of service providers wherein theselecting step includes selecting, by the stub, a particular serviceprovider, from the list of plurality of service providers, if both anaffinity exists for the particular service provider and the particularservice provider provides a service requested, and, wherein an affinityexists for a particular service provider when that particular serviceprovider, or the server associated with the service provider, iscurrently participating in the transaction.
 22. The method of claim 21,wherein the list of service providers is obtained from a naming service.23. The method of claim 21, wherein the list of service providers isobtained from a naming service.
 24. The method of claim 21, wherein ifno affinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the step of selecting further includes the step of:selecting a service provider, by the stub, from the list of serviceproviders in a round robin manner.
 25. The method of claim 21, whereinif no affinity for a service provider exists, or if the particularservice provider for which the affinity exists does not provide theservice requested, then the step of selecting further includes the stepof: selecting a service provider, by the stub, randomly from the list ofservice providers.
 26. The method of claim 21, wherein if no affinityfor a service provider exists, or if the particular service provider forwhich the affinity exists does not provide the service requested, thenthe step of selecting further includes the steps of: obtaining the loadof each service provider, by the stub, in the list of service providers;and, selecting a service provider, by the stub, based upon the load ofeach service provider.
 27. The method of claim 21, wherein if noaffinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the step of selecting further includes the steps of:determining the type of data requested; and, selecting a serviceprovider, by the stub, from the list of service providers based upon thedata type.
 28. The method of claim 21, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thestep of selecting further includes the steps of: determining thephysical distance to each service provider, by the stub, in the list ofservice providers; and, selecting a service provider, by the stub, fromthe list of service providers based upon on the closest physicaldistance to the service provider.
 29. The method of claim 21, wherein ifno affinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the step of selecting further includes the steps of:determining a time period for each service provider, by the stub, in thelist of service providers to respond; and, selecting a service providerfrom the list of service providers based upon the time period for eachservice provider to respond.
 30. A processing device implemented method,comprising: obtaining a calling thread; determining, by a client, if thecalling thread has an affinity for a server, wherein an affinity existsfor a particular server when that particular server is currentlyparticipating in a transaction between the server and the client;determining if the server provides a service; obtaining a list ofservices, wherein the service is in the list of services providers; and,attempting to obtain the service.
 31. The method of claim 30, furthercomprising: obtaining a failover method if the service is not available.32. The method of claim 31, wherein the failover method obtains a nextservice provider in the list of service providers.
 33. The method ofclaim 31, wherein the failover method obtains a randomly selectedservice provider in the list of service providers.
 34. The method ofclaim 31, wherein the failover method obtains a service provider withthe least load in the list of service providers.
 35. The method of claim31, wherein the failover method obtains a service provider based on adata type in the list of service providers.
 36. The method of claim 31,wherein the failover method obtains a service provider based on theclosest physical distance to the service provider.
 37. The method ofclaim 31, wherein the failover method obtains a service provider basedon a time for a response from a service provider in the plurality ofservice providers.
 38. A method of providing failover in a distributedprocessing system, to select which service provider within a pluralityof service providers should respond to a request from a client to accessa service, the method comprising the steps of: determining whether theclient has an affinity for a particular service provider within theplurality of service providers; if the client does have an affinity fora particular service provider then the substeps of determining whetherthe particular service provider can provide the service requested, and,returning the name of that service provider to the client; if the clientdoes not have an affinity for a particular service provider, or if theparticular service provider is no longer available to provide theservice requested, then the substeps of selecting a new service providerfrom the plurality of service providers, and, returning the name of thenew service provider to the client; and, allowing the client to accessthe service using the named service provider, if the named serviceprovider exists and can provide the service.
 39. The method of claim 38wherein said step (B) of determining whether the client has an affinityfor a particular service provider includes determining which serviceprovider is coordinating the current transaction between the client andthe server, and identifying that service provider as the particularservice provider which the client has an affinity for.
 40. The method ofclaim 38 wherein said step of selecting a new service provider includesselecting a new service provider from a list of service providers. 41.The method of claim 38 wherein said step of selecting a new serviceprovider includes selecting a service provider from a list of serviceproviders which is maintained by a naming service.
 42. The method ofclaim 38 wherein said step of selecting a new service provider includescalling a get.next.provider function to obtain and select the nextservice provider on the list of service providers.
 43. The method ofclaim 38 further comprising, following said step (D) of allowing theclient to request service from the named service provider, theadditional steps of: (E) if the named service provider does not exist orcannot provide the service, then calling a failover method that includesthe substeps of identifying the named service provider as a failedservice provider, selecting a failover service provider from theplurality of service providers, and, returning the name of the failoverservice provider to the client.
 44. The method of claim 38 furthercomprising the step of: removing the failed service provider from a listof available service providers within the distributed processing system.45. The method of claim 38 wherein the service is a database or filesystem.
 46. The method of claim 38, wherein if no affinity for a serviceprovider exists, or if the particular service provider for which theaffinity exists does not provide the service requested, then the systemselects a service provider from the list of plurality of serviceproviders in a round robin manner.
 47. The method of claim 38, whereinif no affinity for a service provider exists, or if the particularservice provider for which the affinity exists does not provide theservice requested, then the system randomly selects a service providerfrom the list of service providers.
 48. The method of claim 38, whereinif no affinity for a service provider exists, or if the particularservice provider for which the affinity exists does not provide theservice requested, then the system selects a service provider from thelist of service providers based upon the load of each service provider.49. The method of claim 38, wherein if no affinity for a serviceprovider exists, or if the particular service provider for which theaffinity exists does not provide the service requested, then the systemselects a service provider from the list of service providers based uponthe data type requested.
 50. The method of claim 38, wherein if noaffinity for a service provider exists, or if the particular serviceprovider for which the affinity exists does not provide the servicerequested, then the system selects a service provider from the list ofservice providers based upon the closest physical service provider. 51.The method of claim 38, wherein if no affinity for a service providerexists, or if the particular service provider for which the affinityexists does not provide the service requested, then the system selects aservice provider from the list of service providers based upon a timeperiod in which each service provider responds.
 52. A method of usingload balancing and/or failover in a distributed processing system toselect which a service provider within a plurality of service providerscan respond to a transaction request from a client to access a service,the method comprising the steps of: (A) receiving a transaction requestfrom a client to access a service; (B) determining whether the clienthas an affinity for a particular service provider within said pluralityof service providers; (C1) if the client does have an affinity for aparticular service provider then the substeps of determining whether theparticular service provider can provide the service requested, and,returning the name of the particular service provider to the client foruse by the client in accessing the service; (C2) if the client does nothave an affinity for a particular service provider, then the substeps ofselecting a new service provider from the plurality of serviceproviders, determining whether the new service provider can provide theservice requested, and, returning the name of the new service providerto the client for use by the client in accessing the service; and, (D)allowing the client to request service from the named service provider,if the named service provider is available and can provide access to theservice requested.
 53. The method of claim 52 wherein said step (B) ofdetermining whether the client has an affinity for a particular serviceprovider includes determining which service provider is coordinating thecurrent transaction between the client and the server, and identifyingthat service provider as the particular service provider which theclient has an affinity for.
 54. The method of claim 52 wherein said stepof selecting a new service provider includes selecting a new serviceprovider from a list of service providers.
 55. The method of claim 52wherein said step of selecting a new service provider includes selectinga service provider from a list of service providers which is maintainedby a naming service.
 56. The method of claim 52 wherein said step ofselecting a new service provider includes calling a get.next.providerfunction to obtain and select the next service provider on the list ofservice providers.
 57. The method of claim 52 further comprising,following said step (D) of allowing the client to request service fromthe named service provider, the additional steps of: (E) if the namedservice provider does not exist or cannot provide the service, thencalling a failover method that includes the substeps of identifying thenamed service provider as a failed service provider, selecting afailover service provider from the plurality of service providers, and,returning the name of the failover service provider to the client. 58.The method of claim 52 further comprising the step of: removing thefailed service provider from a list of available service providerswithin the distributed processing system.
 59. The method of claim 52wherein the service is a database or file system.
 60. The method ofclaim 52, wherein if no affinity for a service provider exists, or ifthe particular service provider for which the affinity exists does notprovide the service requested, then the system selects a serviceprovider from the list of plurality of service providers in a roundrobin manner.
 61. The method of claim 52, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thesystem randomly selects a service provider from the list of serviceproviders.
 62. The method of claim 52, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thesystem selects a service provider from the list of service providersbased upon the load of each service provider.
 63. The method of claim52, wherein if no affinity for a service provider exists, or if theparticular service provider for which the affinity exists does notprovide the service requested, then the system selects a serviceprovider from the list of service providers based upon the data typerequested.
 64. The method of claim 52, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thesystem selects a service provider from the list of service providersbased upon the closest physical service provider.
 65. The method ofclaim 52, wherein if no affinity for a service provider exists, or ifthe particular service provider for which the affinity exists does notprovide the service requested, then the system selects a serviceprovider from the list of service providers based upon a time period inwhich each service provider responds.
 66. A system for load balancingand failover of requests by a client to access a service in adistributed processing system comprising: a handler for receivingrequests from a client to access a service; a plurality of serviceproviders for providing client access to the service; software code thatperforms the method of determining whether the client has an affinityfor a particular service provider within the plurality of serviceproviders; if the client does have an affinity for a particular serviceprovider then the substeps of determining whether the particular serviceprovider can provide the service requested, and, returning the name ofthat service provider to the client; if the client does not have anaffinity for a service provider, then the substeps of selecting a newservice provider from the plurality of service providers, and, returningthe name of the new service provider to the client; and, allowing theclient to access the service using the named service provider, if thenamed service provider exists and can provide the service.
 67. Thesystem of claim 66 further comprising: a list of currently availableservice providers, and, wherein a failed service provider is removedfrom the list of service providers.
 68. The system of claim 66 whereinthe service is a database or file system.
 69. The system of claim 66,wherein if no affinity for a service provider exists, or if theparticular service provider for which the affinity exists does notprovide the service requested, then the system selects a serviceprovider from the list of plurality of service providers in a roundrobin manner.
 70. The system of claim 66, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thesystem randomly selects a service provider from the list of serviceproviders.
 71. The system of claim 66, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thesystem selects a service provider from the list of service providersbased upon the load of each service provider.
 72. The system of claim66, wherein if no affinity for a service provider exists, or if theparticular service provider for which the affinity exists does notprovide the service requested, then the system selects a serviceprovider from the list of service providers based upon the data typerequested.
 73. The system of claim 66, wherein if no affinity for aservice provider exists, or if the particular service provider for whichthe affinity exists does not provide the service requested, then thesystem selects a service provider from the list of service providersbased upon the closest physical service provider.
 74. The system ofclaim 66, wherein if no affinity for a service provider exists, or ifthe particular service provider for which the affinity exists does notprovide the service requested, then the system selects a serviceprovider from the list of service providers based upon a time period inwhich each service provider responds.